import { HttpSrv } from 'lfun-bg-comp';

export interface CreateStudentSessionInfo {
  session_name?: string;
  session_alias?: string;
}

export interface UpdateStudentSessionInfo {
  session_id: string;
  session_name?: string;
  session_alias?: string;
  session_status?: string;
}

export interface SearchStudentSessionInfo {
  session_name?: string;
  session_alias?: string;
  session_status?: string;
}

// 新增
export const create = (params: CreateStudentSessionInfo) =>
  HttpSrv().post('/school/v1/current-student/student-session', params);
// 更新
export const update = (params: UpdateStudentSessionInfo) =>
  HttpSrv().patch('/school/v1/current-student/student-session', params);
// 届别管理 - 分页查询
export const search = (params: SearchStudentSessionInfo, page: number, per_page: number) =>
  HttpSrv().get('/school/v1/current-student/session', { params: { ...params, page, per_page } });

export const sessionSearch = (params: SearchStudentSessionInfo) =>
  HttpSrv().get('/school/v1/current-student/session', { params: { ...params, page: 1, per_page: 1000 } });
